#ifndef QTAV_VIDEODECODER_H
#define QTAV_VIDEODECODER_H

#include <QtAV/AVDecoder.h>
#include <QtAV/FactoryDefine.h>

class QSize;
struct SwsContext;
namespace QtAV {

typedef int VideoDecoderId;
class VideoDecoder;
FACTORY_DECLARE(VideoDecoder)


class VideoDecoderPrivate;
class Q_AV_EXPORT VideoDecoder : public AVDecoder
{
    DPTR_DECLARE_PRIVATE(VideoDecoder)
public:
    VideoDecoder();
    virtual ~VideoDecoder();
    //virtual bool prepare();
    virtual bool prepare();
    virtual bool decode(const QByteArray &encoded);
    //TODO: new api: originalVideoSize()(inSize()), decodedVideoSize()(outSize())
    //size: the decoded(actually then resized in ImageConverter) frame size
    void resizeVideoFrame(const QSize& size);
    virtual void resizeVideoFrame(int width, int height);
    //TODO: decodedSize()
    int width() const;
    int height() const;

protected:
    VideoDecoder(VideoDecoderPrivate& d);
};

} //namespace QtAV
#endif // QTAV_VIDEODECODER_H
